public class Person {

	private String firstName;
	private String lastName;
	private int age;
	private int hashCode = 0;

	public Person(String firstName, String lastName, int age) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.age = age;
	}

	@Override
	public boolean equals(Object obj) {

		if (this == obj)
			return true;
		if (!(obj instanceof Person))
			return false;

		Person pers = (Person) obj;

		return EqualsUtil.areEqual(this.firstName, pers.firstName)
				&& EqualsUtil.areEqual(this.lastName, pers.lastName)
				&& EqualsUtil.areEqual(this.age, pers.age);
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		if (hashCode == 0) {
			int result = HashCodeUtil.SEED;
			result = HashCodeUtil.hash(result, firstName);
			result = HashCodeUtil.hash(result, lastName);
			result = HashCodeUtil.hash(result, age);
			hashCode = result;
		}
		return hashCode;

	}

}
